﻿<%@Application Language="C#" Inherits="Micua.UI.MicuaApp"%>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Web.Http" %>
<%@ Import Namespace="System.Web.Mvc" %>
<%@ Import Namespace="System.Web.Optimization" %>
<%@ Import Namespace="System.Web.Routing" %>
<%@ Import Namespace="Micua.Core.IoC" %>
<%@ Import Namespace="Micua.Core.Routing" %>
<%@ Import Namespace="Micua.Core.Tracing" %>
<%@ Import Namespace="Micua.UI.Config" %>

<script runat="server" Language="C#">
    protected override void Application_Start(object sender, EventArgs e)    {
        //初始化IoC
        IoCHelper.InitializeWith(new DependencyResolverFactory());
    
        //注册自定义的控制器，使MVC控制器可以支持依赖注入
        ControllerBuilder.Current.SetControllerFactory(new ResolverControllerFactory().GetControllerFactory());

        //注册路由
        RouteConfig.RegisterRoutes(RouteTable.Routes);
    }
</script>